declare const state: Record<string, unknown>;
interface GetStateOptions {
    default?: unknown;
    namespace?: string;
}
interface SetStateOptions {
    namespace?: string;
    persist?: boolean;
}
interface StateOptions {
    persist?: boolean;
}
/**
 * States are your Robo's personal memory bank.
 *
 * ```ts
 * import { State } from 'robo.js'
 *
 * // Set a value in the state
 * State.set('key', 'value')
 *
 * // Get a value from the state
 * const value = State.get('key')
 * ```
 *
 * States are ephemerally in-memory; data is lost when stopped but not when restarted.
 *
 * [**Learn more:** State Management](https://robojs.dev/robojs/state)
 */
declare class State {
    private static readonly _prefixes;
    private readonly _prefix;
    private readonly _options?;
    constructor(prefix: string, options?: StateOptions);
    /**
     * Creates a new state fork.
     * This is useful for preventing state collisions between different parts of the Robo.
     *
     * @param prefix Fork prefix (e.g. 'polls')
     * @param options Options for the fork (persisting all state by default)
     * @returns A new state fork you can deconstruct (e.g. `const { getState, setState } = State.fork('polls')`
     */
    static fork(prefix: string, options?: StateOptions): State;
    static listForks(): string[];
    /**
     * Get a value from the forked state.
     * If the value does not exist, null is returned.
     *
     * @param key The key to get the value for.
     * @returns The value for the given key, or null if the key does not exist.
     */
    static get<T = string>(key: string, options?: GetStateOptions): T;
    /**
     * Set a value in the forked state.
     * When the persist option is set to true, the state will be persisted to disk.
     *
     * @param key The key to set the value for.
     * @param value The value to set.
     * @param options Options for setting the state. (Persisting to disk)
     */
    static set<T>(key: string, value: T, options?: SetStateOptions): void;
    /**
     * Creates a new state fork.
     *
     * @param prefix - Fork prefix (e.g. 'polls')
     * @param options - Options for the fork (persisting all state by default)
     * @returns - A new state fork you can deconstruct (e.g. `const { getState, setState } = State.fork('polls')`
     */
    fork(prefix: string, options?: StateOptions): State;
    /**
     * Get a value from the forked state.
     * If the value does not exist, null is returned.
     *
     * @param key The key to get the value for.
     * @returns The value for the given key, or null if the key does not exist.
     */
    getState<T = string>(key: string): T | null;
    /**
     * Set a value in the forked state.
     * When the persist option is set to true, the state will be persisted to disk.
     *
     * @param key The key to set the value for.
     * @param value The value to set.
     * @param options Options for setting the state. (Persisting to disk)
     */
    setState<T>(key: string, value: T, options?: SetStateOptions): void;
}
/**
 * Class instances are not serializable.
 * This function removes them from the state while preserving the rest of the state.
 */
declare function removeInstances(value: unknown, warned?: {
    value: boolean;
}): unknown;
declare function clearState(): void;
/**
 * Get a value from the state.
 * If the value does not exist, null is returned.
 *
 * @param key The key to get the value for.
 * @returns The value for the given key, or null if the key does not exist.
 */
declare function getState<T = string>(key: string, options?: GetStateOptions): T | null;
declare function loadState(savedState: Record<string, unknown>): void;
declare function saveState(): void;
/**
 * Set a value in the state.
 * When the persist option is set to true, the state will be persisted to disk.
 *
 * @param key The key to set the value for.
 * @param value The value to set.
 * @param options Options for setting the state. (Persisting to disk)
 */
declare function setState<T>(key: string, value: T | ((oldValue: T) => T), options?: SetStateOptions): T;

export { GetStateOptions, SetStateOptions, State, StateOptions, clearState, getState, loadState, removeInstances, saveState, setState, state };
